#ifndef _XMLUTILS_H
#define _XMLUTILS_H

#include <list>
#include <string>
#include <stdexcept>

#include "rapidxml.hpp"

typedef rapidxml::xml_document<> XmlDocument;
typedef rapidxml::xml_node<> XmlNode;

/*!
 * \class XmlUtils
 * \brief 
 */
class XmlUtils
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
public:
    static std::string SEPARATOR;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    virtual ~XmlUtils(void) = 0;

    static const std::list< XmlNode* > getNodes(const std::string& path, XmlDocument& doc);
    static const int getINT32(const std::string& path, XmlDocument& doc);
    static const unsigned int getUINT32(const std::string& path, XmlDocument& doc);
    static const float getFLOAT32(const std::string& path, XmlDocument& doc);
    static const std::string getString(const std::string& path, XmlDocument& doc);
    static const int getINT32(const std::string& path, XmlNode* rootNode);
    static const unsigned int getUINT32(const std::string& path, XmlNode* rootNode);
    static const float getFLOAT32(const std::string& path, XmlNode* rootNode);
    static const std::string getString(const std::string& path, XmlNode* rootNode);
    static const std::string readAll(const std::string& filename) throw(...);

private:
    static const std::list<std::string> splitPath(const std::string& path) throw(...);
    static XmlNode* findNode(std::list<std::string> &nodeList, XmlDocument &doc) throw(...);
    static XmlNode* findNode(const std::string& path, XmlDocument &doc) throw(...);
    static XmlNode* getNode(const std::list<std::string> &nodeList, XmlNode *rootNode) throw(...);

};

#endif
